package com.ftg.shopping.sp_buyerinfo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ftg.shopping.config.LayuiPage;
import com.ftg.shopping.sp_buyerinfo.entity.SpBuyerinfo;
import com.ftg.shopping.sp_buyerinfo.mapper.SpBuyerinfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Service
public class SpBuyerinfoService {

    @Autowired
    SpBuyerinfoMapper sp_deptinfoMapper;


    public LayuiPage<SpBuyerinfo> layuipage(int page,int limit,String search) {
        IPage<SpBuyerinfo> ip = new Page<>(page, limit);
        QueryWrapper qw = new QueryWrapper();
        qw.like("goodsid", search);
        sp_deptinfoMapper.selectPage(ip, search == null || search.equals("") ? null : qw);
        return new LayuiPage<>(ip);

    }
}